package com.lcj.bff.driver.feign;

import com.lcj.bff.driver.config.MultipartSupportConfig;
import com.lcj.bff.driver.controller.form.InsertOrderGpsForm;
import com.lcj.bff.driver.controller.form.SearchOrderForm;
import com.lcj.common.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(value = "aoch-nebula", configuration = MultipartSupportConfig.class)
public interface NebulaServiceApi {
    
    @PostMapping(value = "/monitoring/uploadRecordFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public Result uploadRecordFile(@RequestPart(value = "file") MultipartFile file,
                                   @RequestPart("name") String name,
                                   @RequestPart(value = "text", required = false) String text);

    @PostMapping(value = "/monitoring/insertOrderMonitoring")
    public Result insertOrderMonitoring(SearchOrderForm form);

    @PostMapping("/order/gps/insertOrderGps")
    public Result insertOrderGps(InsertOrderGpsForm form);

    /**
     * 计算订单实际里程
     * @param form
     * @return
     */
    @PostMapping("/order/gps/calculateOrderMileage")
    public Result calculateOrderMileage(SearchOrderForm form);
}